<template>
    <article>
        <Slider :items="items" :cname="$style.slider"/>

        <section :class="$style.list">
            <div :class="$style.item" v-for="item in enters" :key="item.img">
                <router-link :to="{ name : item.href }">
                    <img :src="item.img" :alt="item.title">
                    <h4>{{ item.title }}</h4>
                </router-link>
            </div>
        </section>
    </article>
</template>

<script>
    import Slider from '../core/slider.vue'  // 导入滑块组件
    export default {
        components : {
            Slider
        },

        data(){
            return {
                items  : [
                    {
                        href : 'home',
                        src  : '//img12.360buyimg.com/jrpmobile/jfs/t1/3303/40/774/25875/5b926122Ef5882de1/287bc45eb222caf2.jpg?width=750&height=320'
                    },
                    {
                        href : 'home',
                        src  : '//img12.360buyimg.com/jrpmobile/jfs/t1/3633/29/751/67163/5b92614bEd29a9c4d/26f5a86060d75407.jpg?width=750&height=320'
                    },
                    {
                        href : 'home',
                        src  : '//img12.360buyimg.com/jrpmobile/jfs/t1/1883/22/739/47332/5b92616aEd5c63641/8315c51574418b7c.jpg?width=750&height=320'
                    },
                    {
                        href : 'home',
                        src  : '//img12.360buyimg.com/jrpmobile/jfs/t1/5503/2/745/42780/5b92618cEd9cfdcaa/7c749b751594aac8.jpg?width=750&height=320'
                    },
                ],

                enters : [
                    {
                        href  : 'download',
                        img   : '//img12.360buyimg.com/jrpmobile/jfs/t3991/64/2521945388/12110/93c0139/58d1e462Ncf294123.png?width=132&height=132',
                        title : '优惠券'
                    },
                    {
                        href  : 'home',
                        img   : '//img12.360buyimg.com/jrpmobile/jfs/t5590/252/875247023/17343/946aa72c/59224650N0f7ffc92.png?width=132&height=132',
                        title : '领福利'
                    },
                    {
                        href  : 'home',
                        img   : '//img12.360buyimg.com/jrpmobile/jfs/t5488/298/1036263348/12073/b4f4de97/590ac8e8Ne9def22e.png?width=135&height=135',
                        title : '白条提额'
                    },
                    {
                        href  : 'home',
                        img   : '//img12.360buyimg.com/jrpmobile/jfs/t1/520/34/950/3686/5b9239e3Eaaf5465c/8d8c35badacfc114.png?width=90&height=90',
                        title : '工资理财'
                    },
                    {
                        href  : 'home',
                        img   : '//img12.360buyimg.com/jrpmobile/jfs/t1/479/25/929/9198/5b9243aaE826fc97b/37ef0a7cdfd24238.png?width=120&height=120',
                        title : '电影票'
                    }
                ]
            }
        }
    }
</script>

<style lang="scss" module>
    @import '../../css/element.scss';
    .slider {
        margin-top: 120px;
        img {
            width: 100%;
            height: 100%;
        }
    }
    .list {
        @include list(row);
        background: #fff;
        padding-top: 40px;
        padding-bottom: 20px;
        justify-content: space-around;

        .item {
            text-align: center;
            img {
                display: inline-block;
                width: 90px;
                height: 90px;
            }
            h4 {
                font-size: 26px;
                margin-top: 12px;
                color: #666;
            }
        }
    }
    
</style>